package com.startdima.user.infrastructure.dto;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

@Data
@AllArgsConstructor
@Builder
public class SddmResult implements Serializable {
	
    private static final long serialVersionUID = 5773283302091208323L;
    
    protected int code;
    
    protected String msg;
    
    protected Object data;

    public SddmResult() {
        this.code = 0;
        this.msg = "OK";
    }
    
    public SddmResult(Object data) {
        this.code = 0;
        this.msg = "OK";
        this.data = data;
    }
 
    public SddmResult(int code, String message) {
        this.code = code;
        this.msg = message;
    }
    
    public SddmResult(boolean success, String message) {
        if (success) {
            this.code = 0;
        } else {
            this.code = 500;
        }
        this.msg = message;
    }
    
}